package com.crm.dao.mapper.customMapper.customerManagerCustomMapper;

import com.crm.model.entity.customerManager.CustomerPay;
import com.crm.model.qo.customerManager.CustomerPayQO;
import com.crm.model.vo.customerManager.*;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author:chaifuyou
 * @Date: 2021/4/30 9:49
 */
public interface CustomerPayCustomMapper {

    /**
     * 客户充值列表
     *
     * @param dateUnit
     * @param order
     * @return
     */
    List<CustomerPayVO> selectCustomerPayList(@Param("dateUnit") Integer dateUnit, @Param("order") StringBuilder order, @Param("qo") CustomerPayQO qo);

    /**
     * 通过id查询客户充值信息
     *
     * @param chsCustomerPayId
     * @return
     */
    CustomerPay selectCustomerPayById(@Param("chsCustomerPayId") String chsCustomerPayId);

    /**
     * 财务确认收款
     *
     * @param customerPayId
     */
    void notarizeCustomerPay(@Param("customerPayId") String customerPayId);

    /**
     * 查看充值详情
     *
     * @param customerPayId
     * @return
     */
    CustomerPayDetailVO queryCustomerPayDetail(@Param("customerPayId") String customerPayId);

    /**
     * 充值总数
     *
     * @param companyId
     * @return
     */
    BigDecimal selectPayMoneyCount(@Param("companyId") String companyId, @Param("dateUnit") Integer dateUnit);

    /**
     * 修改付款信息
     *
     * @Param cp
     * @Author xielinqi
     * @Date 1:55 下午 2021/11/11
     */
    int updatePayInfo(CustomerPay cp);

    /**
     * 查看详情
     *
     * @Param customerPayId
     * @Author xielinqi
     * @Date 3:38 下午 2021/11/11
     */
    CustomerPayAllInfoVO queryDetail(String customerPayId);

    /**
     * 查看详情
     *
     * @Param customerPayId
     * @Author xielinqi
     * @Date 3:38 下午 2021/11/11
     */
    List<CustomerPayMoneyVO> getPayMoneyByAccountId(@Param("accountIds") List<String> accountIds, @Param("dateStr") String dateStr);

    /**
     * 查看详情
     *
     * @Param customerPayId
     * @Author xielinqi
     * @Date 3:38 下午 2021/11/11
     */
    List<CompanyPayMoneyVO> getPayMoneyByCompanyId(@Param("companyIds") List<String> accountIds, @Param("startDate") String startDate, @Param("endDate") String endDate);


    /**
     */
    List<CustomerPayMoneyVO> getPayMoneyByAccountIdAndDateType(@Param("accountIds") List<String> accountIds, @Param("dateUnit") int dateUnit);

}
